package com.example.administrator.gitglide;

import android.app.Application;

import io.sentry.android.core.SentryAndroid;
import io.sentry.android.core.SentryAndroidOptions;
import io.sentry.core.Sentry;
import io.sentry.core.SentryEvent;
import io.sentry.core.SentryOptions;
import io.sentry.core.protocol.User;

public class MyApplication extends Application {
    public void onCreate() {
        super.onCreate();
        /**
         * Manual Initialization of the Sentry Android SDK
         * @Context - Instance of the Android Context
         * @Options - Call back function that you need to provide to be able to modify the options.
         * The call back function is provided with the options loaded from the manifest.
         *
         */
        SentryAndroid.init(this, new Sentry.OptionsConfiguration<SentryAndroidOptions>() {
            @Override
            public void configure(SentryAndroidOptions options) {
                // Add a callback that will be used before the event is sent to Sentry.
                // With this callback, you can modify the event or, when returning null, also discard the event.
                options.setBeforeSend(new SentryOptions.BeforeSendCallback() {
                    @Override
                    public SentryEvent execute(SentryEvent event, Object hint) {
                        if (BuildConfig.DEBUG)
                            return event;
                        else
                            return event;
                    }
                });
            }
        });
        User user = new User();
        user.setUsername("Zwg");
        Sentry.setUser(user);

    }
}
